const express = require('express')
// 创建路由对象
const router = express.Router()

// 导入用户路由处理函数模块
const roomHandler = require('../router_handler/room')
//房间分类
router.get('/roomMessage',roomHandler.roomMessage) //获取rooms的所有信息

router.post('/upload',roomHandler.uploadHeadFile) // 获取网络地址
router.post('/uploads',roomHandler.uploadFiles) // 获取网络地址

router.post('/insertRoomData',roomHandler.insertRoomData)//插入rooms表一条数据

router.post('/updataRoomData',roomHandler.updataRoomData) //更新rooms表信息

router.get('/delRoomData/:room_id',roomHandler.delRoomData) //删除rooms一条数据

//房间管理
router.get('/getRoomImages/:room_id',roomHandler.getRoomImages) //根据room_id获取房间轮播图片
router.get('/getRoomMessageImg/:room_id',roomHandler.getRoomMessageImg) //根据room_id获取详情图片

router.post('/updataRoomData2',roomHandler.updataRoomData2) //更新rooms表信息
router.post('/insertRoomImages',roomHandler.insertRoomImages)//插入RoomImages表一条数据
router.post('/insertRoomMessageImg',roomHandler.insertRoomMessageImg)//插入RoomMessageImg表一条数据


//删除操作
router.get('/delRoomData2/:room_id',roomHandler.delRoomData2)
router.get('/delRoomImages/:room_id',roomHandler.delRoomImages)//删除RoomImages表一条数据
router.get('/delRoomMessageImg/:room_id',roomHandler.delRoomMessageImg)//删除RoomMessageImg表一条数据


// 将路由对象共享出去
module.exports = router